﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class DALBarrios : DALBase
    {
        private static string cmdTodosLosBarrios = "Select * From Barrios Order By 2 ASC";
        private static string cmdBarrioPorId = "Select * From Barrios where BarId = @BarId";

        public static SqlDataReader BuscarBarrios()
        {
            SqlDataReader dr = select(null, cmdTodosLosBarrios, CommandType.Text);
            return dr;
        }

        public SqlDataReader BuscarBarriosXId(int BarrioId) {
            List<SqlParameter> lstparameters = new List<SqlParameter>();
            lstparameters.Add(new SqlParameter("@BarId", BarrioId));
            SqlDataReader dr = select(lstparameters, cmdBarrioPorId, CommandType.Text);
            return dr;           
        }
    }
}
